<?php

/**
 * description
 */
class BackendPhotoForm extends PhotoForm
{
  /**
   * description
   */
  public function configure()
  {
    parent::configure();

		//照片image
	$this->widgetSchema['image'] = new sfWidgetFormInputFile();
    $this->validatorSchema['image'] = new sfValidatorFile(array(
      'max_size' => 3 * 1024 * 1024,
      'path' => Wills::getUploadDirByWebPath(sfConfig::get('app_path_album_photo')),
      'mime_types' => 'web_images',
	  'required' => $this->isNew()
    ));
    $this->validatorSchema['image']->setMessage('required', '请选择一个要上传的照片');

	$this->widgetSchema['image'] = new sfWidgetFormInputFileEditable(array(
      'is_image' => true,
      'edit_mode' => !$this->isNew(),
      'file_src' => sprintf(sfConfig::get('app_path_album_photo'),$this->getObject()->getImage()),
      'with_delete' => false
    ));
  }
}
